#ifndef _OCPP_ResponseHandler_H__
#define _OCPP_ResponseHandler_H__

#include "Response.h"

namespace OCPP
{
	class _MainExport ResponseHandler
	{
	public:
		ResponseHandler() {}
		virtual ~ResponseHandler() {}

		/** Return whether this handler can process a given response.
		@remarks
		Defaults to true, but if you wish to add several handlers each of
		which deal with different types of response, you can override
		this method.
		*/
		virtual bool canHandleResponse(const Response* res, const WorkQueue* srcQ)
		{
			(void)srcQ; return !res->getRequest()->getAborted();
		}

		/** The handler method every subclass must implement.
		@param res The Response structure. The caller is responsible for
		deleting this after the call is made, none of the data contained
		(except pointers to structures in user Any data) will persist
		after this call is returned.
		@param srcQ The work queue that this request originated from
		*/
		virtual void handleResponse(const Response* res, const WorkQueue* srcQ) = 0;
	};
}

#endif

